<?php

// Create page object
$address_grid = new caddress_grid();
$MasterPage =& $Page;
$Page =& $address_grid;

// Page init
$address_grid->Page_Init();

// Page main
$address_grid->Page_Main();
?>
<?php if ($address->Export == "") { ?>
<script type="text/javascript">
<!--

// Create page object
var address_grid = new ew_Page("address_grid");

// page properties
address_grid.PageID = "grid"; // page ID
address_grid.FormID = "faddressgrid"; // form ID
var EW_PAGE_ID = address_grid.PageID; // for backward compatibility

// extend page with ValidateForm function
address_grid.ValidateForm = function(fobj) {
	ew_PostAutoSuggest(fobj);
	if (!this.ValidateRequired)
		return true; // ignore validation
	if (fobj.a_confirm && fobj.a_confirm.value == "F")
		return true;
	var i, elm, aelm, infix;
	var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
	var addcnt = 0;
	for (i=0; i<rowcnt; i++) {
		infix = (fobj.key_count) ? String(i+1) : "";
		var chkthisrow = true;
		if (fobj.a_list && fobj.a_list.value == "gridinsert")
			chkthisrow = !(this.EmptyRow(fobj, infix));
		else
			chkthisrow = true;
		if (chkthisrow) {
			addcnt += 1;
		elm = fobj.elements["x" + infix + "_poskod"];
		if (elm && !ew_CheckInteger(elm.value))
			return ew_OnError(this, elm, "<?php echo ew_JsEncode2($address->poskod->FldErrMsg()) ?>");
		elm = fobj.elements["x" + infix + "_state_id"];
		if (elm && !ew_HasValue(elm))
			return ew_OnError(this, elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($address->state_id->FldCaption()) ?>");
		elm = fobj.elements["x" + infix + "_country_id"];
		if (elm && !ew_HasValue(elm))
			return ew_OnError(this, elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($address->country_id->FldCaption()) ?>");

		// Set up row object
		var row = {};
		row["index"] = infix;
		for (var j = 0; j < fobj.elements.length; j++) {
			var el = fobj.elements[j];
			var len = infix.length + 2;
			if (el.name.substr(0, len) == "x" + infix + "_") {
				var elname = "x_" + el.name.substr(len);
				if (ewLang.isObject(row[elname])) { // already exists
					if (ewLang.isArray(row[elname])) {
						row[elname][row[elname].length] = el; // add to array
					} else {
						row[elname] = [row[elname], el]; // convert to array
					}
				} else {
					row[elname] = el;
				}
			}
		}
		fobj.row = row;

		// Call Form Custom Validate event
		if (!this.Form_CustomValidate(fobj)) return false;
		} // End Grid Add checking
	}
	return true;
}

// Extend page with empty row check
address_grid.EmptyRow = function(fobj, infix) {
	if (ew_ValueChanged(fobj, infix, "nama", false)) return false;
	if (ew_ValueChanged(fobj, infix, "address_1", false)) return false;
	if (ew_ValueChanged(fobj, infix, "poskod", false)) return false;
	if (ew_ValueChanged(fobj, infix, "city", false)) return false;
	if (ew_ValueChanged(fobj, infix, "notel", false)) return false;
	if (ew_ValueChanged(fobj, infix, "state_id", false)) return false;
	if (ew_ValueChanged(fobj, infix, "country_id", false)) return false;
	return true;
}

// extend page with Form_CustomValidate function
address_grid.Form_CustomValidate =  
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }
<?php if (EW_CLIENT_VALIDATE) { ?>
address_grid.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
address_grid.ValidateRequired = false; // no JavaScript validation
<?php } ?>

//-->
</script>
<?php } ?>
<?php
if ($address->CurrentAction == "gridadd") {
	if ($address->CurrentMode == "copy") {
		$bSelectLimit = EW_SELECT_LIMIT;
		if ($bSelectLimit) {
			$address_grid->TotalRecs = $address->SelectRecordCount();
			$address_grid->Recordset = $address_grid->LoadRecordset($address_grid->StartRec-1, $address_grid->DisplayRecs);
		} else {
			if ($address_grid->Recordset = $address_grid->LoadRecordset())
				$address_grid->TotalRecs = $address_grid->Recordset->RecordCount();
		}
		$address_grid->StartRec = 1;
		$address_grid->DisplayRecs = $address_grid->TotalRecs;
	} else {
		$address->CurrentFilter = "0=1";
		$address_grid->StartRec = 1;
		$address_grid->DisplayRecs = $address->GridAddRowCount;
	}
	$address_grid->TotalRecs = $address_grid->DisplayRecs;
	$address_grid->StopRec = $address_grid->DisplayRecs;
} else {
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$address_grid->TotalRecs = $address->SelectRecordCount();
	} else {
		if ($address_grid->Recordset = $address_grid->LoadRecordset())
			$address_grid->TotalRecs = $address_grid->Recordset->RecordCount();
	}
	$address_grid->StartRec = 1;
	$address_grid->DisplayRecs = $address_grid->TotalRecs; // Display all records
	if ($bSelectLimit)
		$address_grid->Recordset = $address_grid->LoadRecordset($address_grid->StartRec-1, $address_grid->DisplayRecs);
}
?>
<p class="phpmaker ewTitle" style="white-space: nowrap;"><?php if ($address->CurrentMode == "add" || $address->CurrentMode == "copy") { ?><?php echo $Language->Phrase("Add") ?><?php } elseif ($address->CurrentMode == "edit") { ?><?php echo $Language->Phrase("Edit") ?><?php } ?>&nbsp;<?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $address->TableCaption() ?></p>
</p>
<?php $address_grid->ShowPageHeader(); ?>
<?php
$address_grid->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div id="gmp_address" class="ewGridMiddlePanel">
<table cellspacing="0" data-rowhighlightclass="ewTableHighlightRow" data-rowselectclass="ewTableSelectRow" data-roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $address->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

// Render list options
$address_grid->RenderListOptions();

// Render list options (header, left)
$address_grid->ListOptions->Render("header", "left");
?>
<?php if ($address->id->Visible) { // id ?>
	<?php if ($address->SortUrl($address->id) == "") { ?>
		<td><?php echo $address->id->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->id->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->id->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->id->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->nama->Visible) { // nama ?>
	<?php if ($address->SortUrl($address->nama) == "") { ?>
		<td><?php echo $address->nama->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->nama->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->nama->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->nama->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->address_1->Visible) { // address ?>
	<?php if ($address->SortUrl($address->address_1) == "") { ?>
		<td><?php echo $address->address_1->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->address_1->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->address_1->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->address_1->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->poskod->Visible) { // poskod ?>
	<?php if ($address->SortUrl($address->poskod) == "") { ?>
		<td><?php echo $address->poskod->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->poskod->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->poskod->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->poskod->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->city->Visible) { // city ?>
	<?php if ($address->SortUrl($address->city) == "") { ?>
		<td><?php echo $address->city->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->city->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->city->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->city->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->notel->Visible) { // notel ?>
	<?php if ($address->SortUrl($address->notel) == "") { ?>
		<td><?php echo $address->notel->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->notel->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->notel->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->notel->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->state_id->Visible) { // state_id ?>
	<?php if ($address->SortUrl($address->state_id) == "") { ?>
		<td><?php echo $address->state_id->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->state_id->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->state_id->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->state_id->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->country_id->Visible) { // country_id ?>
	<?php if ($address->SortUrl($address->country_id) == "") { ?>
		<td><?php echo $address->country_id->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->country_id->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->country_id->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->country_id->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->created_date->Visible) { // created_date ?>
	<?php if ($address->SortUrl($address->created_date) == "") { ?>
		<td><?php echo $address->created_date->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->created_date->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->created_date->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->created_date->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($address->modified_date->Visible) { // modified_date ?>
	<?php if ($address->SortUrl($address->modified_date) == "") { ?>
		<td><?php echo $address->modified_date->FldCaption() ?></td>
	<?php } else { ?>
		<td><div>
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $address->modified_date->FldCaption() ?></td><td style="width: 10px;"><?php if ($address->modified_date->getSort() == "ASC") { ?><img src="phpimages/sortup.gif" width="10" height="9" border="0"><?php } elseif ($address->modified_date->getSort() == "DESC") { ?><img src="phpimages/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php

// Render list options (header, right)
$address_grid->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<?php
$address_grid->StartRec = 1;
$address_grid->StopRec = $address_grid->TotalRecs; // Show all records

// Restore number of post back records
if ($objForm) {
	$objForm->Index = 0;
	if ($objForm->HasValue("key_count") && ($address->CurrentAction == "gridadd" || $address->CurrentAction == "gridedit" || $address->CurrentAction == "F")) {
		$address_grid->KeyCount = $objForm->GetValue("key_count");
		$address_grid->StopRec = $address_grid->KeyCount;
	}
}
$address_grid->RecCnt = $address_grid->StartRec - 1;
if ($address_grid->Recordset && !$address_grid->Recordset->EOF) {
	$address_grid->Recordset->MoveFirst();
	if (!$bSelectLimit && $address_grid->StartRec > 1)
		$address_grid->Recordset->Move($address_grid->StartRec - 1);
} elseif (!$address->AllowAddDeleteRow && $address_grid->StopRec == 0) {
	$address_grid->StopRec = $address->GridAddRowCount;
}

// Initialize aggregate
$address->RowType = EW_ROWTYPE_AGGREGATEINIT;
$address->ResetAttrs();
$address_grid->RenderRow();
$address_grid->RowCnt = 0;
if ($address->CurrentAction == "gridadd")
	$address_grid->RowIndex = 0;
if ($address->CurrentAction == "gridedit")
	$address_grid->RowIndex = 0;
while ($address_grid->RecCnt < $address_grid->StopRec) {
	$address_grid->RecCnt++;
	if (intval($address_grid->RecCnt) >= intval($address_grid->StartRec)) {
		$address_grid->RowCnt++;
		if ($address->CurrentAction == "gridadd" || $address->CurrentAction == "gridedit" || $address->CurrentAction == "F")
			$address_grid->RowIndex++;

		// Set up key count
		$address_grid->KeyCount = $address_grid->RowIndex;

		// Init row class and style
		$address->ResetAttrs();
		$address->CssClass = "";
		if ($address->CurrentAction == "gridadd") {
			if ($address->CurrentMode == "copy") {
				$address_grid->LoadRowValues($address_grid->Recordset); // Load row values
				$address_grid->SetRecordKey($address_grid->RowOldKey, $address_grid->Recordset); // Set old record key
			} else {
				$address_grid->LoadDefaultValues(); // Load default values
				$address_grid->RowOldKey = ""; // Clear old key value
			}
		} elseif ($address->CurrentAction == "gridedit") {
			$address_grid->LoadRowValues($address_grid->Recordset); // Load row values
		}
		$address->RowType = EW_ROWTYPE_VIEW; // Render view
		if ($address->CurrentAction == "gridadd") // Grid add
			$address->RowType = EW_ROWTYPE_ADD; // Render add
		if ($address->CurrentAction == "gridadd" && $address->EventCancelled) // Insert failed
			$address_grid->RestoreCurrentRowFormValues($address_grid->RowIndex); // Restore form values
		if ($address->CurrentAction == "gridedit") { // Grid edit
			if ($address->EventCancelled) {
				$address_grid->RestoreCurrentRowFormValues($address_grid->RowIndex); // Restore form values
			}
			if ($address_grid->RowAction == "insert")
				$address->RowType = EW_ROWTYPE_ADD; // Render add
			else
				$address->RowType = EW_ROWTYPE_EDIT; // Render edit
		}
		if ($address->CurrentAction == "gridedit" && ($address->RowType == EW_ROWTYPE_EDIT || $address->RowType == EW_ROWTYPE_ADD) && $address->EventCancelled) // Update failed
			$address_grid->RestoreCurrentRowFormValues($address_grid->RowIndex); // Restore form values
		if ($address->RowType == EW_ROWTYPE_EDIT) // Edit row
			$address_grid->EditRowCnt++;
		if ($address->CurrentAction == "F") // Confirm row
			$address_grid->RestoreCurrentRowFormValues($address_grid->RowIndex); // Restore form values
		if ($address->RowType == EW_ROWTYPE_ADD || $address->RowType == EW_ROWTYPE_EDIT) { // Add / Edit row
			if ($address->CurrentAction == "edit") {
				$address->RowAttrs = array();
				$address->CssClass = "ewTableEditRow";
			} else {
				$address->RowAttrs = array();
			}
			if (!empty($address_grid->RowIndex))
				$address->RowAttrs = array_merge($address->RowAttrs, array('data-rowindex'=>$address_grid->RowIndex, 'id'=>'r' . $address_grid->RowIndex . '_address'));
		} else {
			$address->RowAttrs = array();
		}

		// Render row
		$address_grid->RenderRow();

		// Render list options
		$address_grid->RenderListOptions();

		// Skip delete row / empty row for confirm page
		if ($address_grid->RowAction <> "delete" && $address_grid->RowAction <> "insertdelete" && !($address_grid->RowAction == "insert" && $address->CurrentAction == "F" && $address_grid->EmptyRow())) {
?>
	<tr<?php echo $address->RowAttributes() ?>>
<?php

// Render list options (body, left)
$address_grid->ListOptions->Render("body", "left");
?>
	<?php if ($address->id->Visible) { // id ?>
		<td<?php echo $address->id->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_id" id="o<?php echo $address_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($address->id->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<div<?php echo $address->id->ViewAttributes() ?>><?php echo $address->id->EditValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_id" id="x<?php echo $address_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($address->id->CurrentValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->id->ViewAttributes() ?>><?php echo $address->id->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_id" id="x<?php echo $address_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($address->id->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_id" id="o<?php echo $address_grid->RowIndex ?>_id" value="<?php echo ew_HtmlEncode($address->id->OldValue) ?>">
<?php } ?>
<a name="<?php echo $address_grid->PageObjName . "_row_" . $address_grid->RowCnt ?>" id="<?php echo $address_grid->PageObjName . "_row_" . $address_grid->RowCnt ?>"></a></td>
	<?php } ?>
	<?php if ($address->nama->Visible) { // nama ?>
		<td<?php echo $address->nama->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_nama" id="x<?php echo $address_grid->RowIndex ?>_nama" size="70" maxlength="255" value="<?php echo $address->nama->EditValue ?>"<?php echo $address->nama->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_nama" id="o<?php echo $address_grid->RowIndex ?>_nama" value="<?php echo ew_HtmlEncode($address->nama->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_nama" id="x<?php echo $address_grid->RowIndex ?>_nama" size="70" maxlength="255" value="<?php echo $address->nama->EditValue ?>"<?php echo $address->nama->EditAttributes() ?>>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->nama->ViewAttributes() ?>><?php echo $address->nama->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_nama" id="x<?php echo $address_grid->RowIndex ?>_nama" value="<?php echo ew_HtmlEncode($address->nama->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_nama" id="o<?php echo $address_grid->RowIndex ?>_nama" value="<?php echo ew_HtmlEncode($address->nama->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->address_1->Visible) { // address ?>
		<td<?php echo $address->address_1->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<textarea name="x<?php echo $address_grid->RowIndex ?>_address_1" id="x<?php echo $address_grid->RowIndex ?>_address_1" cols="50" rows="4"<?php echo $address->address_1->EditAttributes() ?>><?php echo $address->address_1->EditValue ?></textarea>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_address_1" id="o<?php echo $address_grid->RowIndex ?>_address_1" value="<?php echo ew_HtmlEncode($address->address_1->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<textarea name="x<?php echo $address_grid->RowIndex ?>_address_1" id="x<?php echo $address_grid->RowIndex ?>_address_1" cols="50" rows="4"<?php echo $address->address_1->EditAttributes() ?>><?php echo $address->address_1->EditValue ?></textarea>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->address_1->ViewAttributes() ?>><?php echo $address->address_1->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_address_1" id="x<?php echo $address_grid->RowIndex ?>_address_1" value="<?php echo ew_HtmlEncode($address->address_1->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_address_1" id="o<?php echo $address_grid->RowIndex ?>_address_1" value="<?php echo ew_HtmlEncode($address->address_1->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->poskod->Visible) { // poskod ?>
		<td<?php echo $address->poskod->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_poskod" id="x<?php echo $address_grid->RowIndex ?>_poskod" size="70" maxlength="255" value="<?php echo $address->poskod->EditValue ?>"<?php echo $address->poskod->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_poskod" id="o<?php echo $address_grid->RowIndex ?>_poskod" value="<?php echo ew_HtmlEncode($address->poskod->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_poskod" id="x<?php echo $address_grid->RowIndex ?>_poskod" size="70" maxlength="255" value="<?php echo $address->poskod->EditValue ?>"<?php echo $address->poskod->EditAttributes() ?>>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->poskod->ViewAttributes() ?>><?php echo $address->poskod->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_poskod" id="x<?php echo $address_grid->RowIndex ?>_poskod" value="<?php echo ew_HtmlEncode($address->poskod->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_poskod" id="o<?php echo $address_grid->RowIndex ?>_poskod" value="<?php echo ew_HtmlEncode($address->poskod->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->city->Visible) { // city ?>
		<td<?php echo $address->city->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_city" id="x<?php echo $address_grid->RowIndex ?>_city" size="70" maxlength="255" value="<?php echo $address->city->EditValue ?>"<?php echo $address->city->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_city" id="o<?php echo $address_grid->RowIndex ?>_city" value="<?php echo ew_HtmlEncode($address->city->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_city" id="x<?php echo $address_grid->RowIndex ?>_city" size="70" maxlength="255" value="<?php echo $address->city->EditValue ?>"<?php echo $address->city->EditAttributes() ?>>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->city->ViewAttributes() ?>><?php echo $address->city->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_city" id="x<?php echo $address_grid->RowIndex ?>_city" value="<?php echo ew_HtmlEncode($address->city->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_city" id="o<?php echo $address_grid->RowIndex ?>_city" value="<?php echo ew_HtmlEncode($address->city->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->notel->Visible) { // notel ?>
		<td<?php echo $address->notel->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_notel" id="x<?php echo $address_grid->RowIndex ?>_notel" size="70" maxlength="255" value="<?php echo $address->notel->EditValue ?>"<?php echo $address->notel->EditAttributes() ?>>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_notel" id="o<?php echo $address_grid->RowIndex ?>_notel" value="<?php echo ew_HtmlEncode($address->notel->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_notel" id="x<?php echo $address_grid->RowIndex ?>_notel" size="70" maxlength="255" value="<?php echo $address->notel->EditValue ?>"<?php echo $address->notel->EditAttributes() ?>>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->notel->ViewAttributes() ?>><?php echo $address->notel->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_notel" id="x<?php echo $address_grid->RowIndex ?>_notel" value="<?php echo ew_HtmlEncode($address->notel->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_notel" id="o<?php echo $address_grid->RowIndex ?>_notel" value="<?php echo ew_HtmlEncode($address->notel->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->state_id->Visible) { // state_id ?>
		<td<?php echo $address->state_id->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<select id="x<?php echo $address_grid->RowIndex ?>_state_id" name="x<?php echo $address_grid->RowIndex ?>_state_id"<?php echo $address->state_id->EditAttributes() ?>>
<?php
if (is_array($address->state_id->EditValue)) {
	$arwrk = $address->state_id->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($address->state_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $address->state_id->OldValue = "";
?>
</select>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_state_id" id="o<?php echo $address_grid->RowIndex ?>_state_id" value="<?php echo ew_HtmlEncode($address->state_id->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<select id="x<?php echo $address_grid->RowIndex ?>_state_id" name="x<?php echo $address_grid->RowIndex ?>_state_id"<?php echo $address->state_id->EditAttributes() ?>>
<?php
if (is_array($address->state_id->EditValue)) {
	$arwrk = $address->state_id->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($address->state_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $address->state_id->OldValue = "";
?>
</select>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->state_id->ViewAttributes() ?>><?php echo $address->state_id->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_state_id" id="x<?php echo $address_grid->RowIndex ?>_state_id" value="<?php echo ew_HtmlEncode($address->state_id->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_state_id" id="o<?php echo $address_grid->RowIndex ?>_state_id" value="<?php echo ew_HtmlEncode($address->state_id->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->country_id->Visible) { // country_id ?>
		<td<?php echo $address->country_id->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<select id="x<?php echo $address_grid->RowIndex ?>_country_id" name="x<?php echo $address_grid->RowIndex ?>_country_id"<?php echo $address->country_id->EditAttributes() ?>>
<?php
if (is_array($address->country_id->EditValue)) {
	$arwrk = $address->country_id->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($address->country_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $address->country_id->OldValue = "";
?>
</select>
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_country_id" id="o<?php echo $address_grid->RowIndex ?>_country_id" value="<?php echo ew_HtmlEncode($address->country_id->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<select id="x<?php echo $address_grid->RowIndex ?>_country_id" name="x<?php echo $address_grid->RowIndex ?>_country_id"<?php echo $address->country_id->EditAttributes() ?>>
<?php
if (is_array($address->country_id->EditValue)) {
	$arwrk = $address->country_id->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($address->country_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $address->country_id->OldValue = "";
?>
</select>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->country_id->ViewAttributes() ?>><?php echo $address->country_id->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_country_id" id="x<?php echo $address_grid->RowIndex ?>_country_id" value="<?php echo ew_HtmlEncode($address->country_id->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_country_id" id="o<?php echo $address_grid->RowIndex ?>_country_id" value="<?php echo ew_HtmlEncode($address->country_id->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->created_date->Visible) { // created_date ?>
		<td<?php echo $address->created_date->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="hidden" name="fo<?php echo $address_grid->RowIndex ?>_created_date" id="fo<?php echo $address_grid->RowIndex ?>_created_date" value="<?php echo ew_HtmlEncode(ew_FormatDateTime($address->created_date->OldValue, 11)) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_created_date" id="o<?php echo $address_grid->RowIndex ?>_created_date" value="<?php echo ew_HtmlEncode($address->created_date->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->created_date->ViewAttributes() ?>><?php echo $address->created_date->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_created_date" id="x<?php echo $address_grid->RowIndex ?>_created_date" value="<?php echo ew_HtmlEncode($address->created_date->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_created_date" id="o<?php echo $address_grid->RowIndex ?>_created_date" value="<?php echo ew_HtmlEncode($address->created_date->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->modified_date->Visible) { // modified_date ?>
		<td<?php echo $address->modified_date->CellAttributes() ?>>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { // Add record ?>
<input type="hidden" name="fo<?php echo $address_grid->RowIndex ?>_modified_date" id="fo<?php echo $address_grid->RowIndex ?>_modified_date" value="<?php echo ew_HtmlEncode(ew_FormatDateTime($address->modified_date->OldValue, 11)) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_modified_date" id="o<?php echo $address_grid->RowIndex ?>_modified_date" value="<?php echo ew_HtmlEncode($address->modified_date->OldValue) ?>">
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { // Edit record ?>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_VIEW) { // View record ?>
<div<?php echo $address->modified_date->ViewAttributes() ?>><?php echo $address->modified_date->ListViewValue() ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_modified_date" id="x<?php echo $address_grid->RowIndex ?>_modified_date" value="<?php echo ew_HtmlEncode($address->modified_date->CurrentValue) ?>">
<input type="hidden" name="o<?php echo $address_grid->RowIndex ?>_modified_date" id="o<?php echo $address_grid->RowIndex ?>_modified_date" value="<?php echo ew_HtmlEncode($address->modified_date->OldValue) ?>">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$address_grid->ListOptions->Render("body", "right");
?>
	</tr>
<?php if ($address->RowType == EW_ROWTYPE_ADD) { ?>
<?php } ?>
<?php if ($address->RowType == EW_ROWTYPE_EDIT) { ?>
<?php } ?>
<?php
	}
	} // End delete row checking
	if ($address->CurrentAction <> "gridadd" || $address->CurrentMode == "copy")
		if (!$address_grid->Recordset->EOF) $address_grid->Recordset->MoveNext();
}
?>
<?php
	if ($address->CurrentMode == "add" || $address->CurrentMode == "copy" || $address->CurrentMode == "edit") {
		$address_grid->RowIndex = '$rowindex$';
		$address_grid->LoadDefaultValues();

		// Set row properties
		$address->ResetAttrs();
		$address->RowAttrs = array();
		if (!empty($address_grid->RowIndex))
			$address->RowAttrs = array_merge($address->RowAttrs, array('data-rowindex'=>$address_grid->RowIndex, 'id'=>'r' . $address_grid->RowIndex . '_address'));
		$address->RowType = EW_ROWTYPE_ADD;

		// Render row
		$address_grid->RenderRow();

		// Render list options
		$address_grid->RenderListOptions();

		// Add id and class to the template row
		$address->RowAttrs["id"] = "r0_address";
		ew_AppendClass($address->RowAttrs["class"], "ewTemplate");
?>
	<tr<?php echo $address->RowAttributes() ?>>
<?php

// Render list options (body, left)
$address_grid->ListOptions->Render("body", "left");
?>
	<?php if ($address->id->Visible) { // id ?>
		<td>&nbsp;</td>
	<?php } ?>
	<?php if ($address->nama->Visible) { // nama ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_nama" id="x<?php echo $address_grid->RowIndex ?>_nama" size="70" maxlength="255" value="<?php echo $address->nama->EditValue ?>"<?php echo $address->nama->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $address->nama->ViewAttributes() ?>><?php echo $address->nama->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_nama" id="x<?php echo $address_grid->RowIndex ?>_nama" value="<?php echo ew_HtmlEncode($address->nama->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->address_1->Visible) { // address ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<textarea name="x<?php echo $address_grid->RowIndex ?>_address_1" id="x<?php echo $address_grid->RowIndex ?>_address_1" cols="50" rows="4"<?php echo $address->address_1->EditAttributes() ?>><?php echo $address->address_1->EditValue ?></textarea>
<?php } else { ?>
<div<?php echo $address->address_1->ViewAttributes() ?>><?php echo $address->address_1->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_address_1" id="x<?php echo $address_grid->RowIndex ?>_address_1" value="<?php echo ew_HtmlEncode($address->address_1->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->poskod->Visible) { // poskod ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_poskod" id="x<?php echo $address_grid->RowIndex ?>_poskod" size="70" maxlength="255" value="<?php echo $address->poskod->EditValue ?>"<?php echo $address->poskod->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $address->poskod->ViewAttributes() ?>><?php echo $address->poskod->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_poskod" id="x<?php echo $address_grid->RowIndex ?>_poskod" value="<?php echo ew_HtmlEncode($address->poskod->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->city->Visible) { // city ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_city" id="x<?php echo $address_grid->RowIndex ?>_city" size="70" maxlength="255" value="<?php echo $address->city->EditValue ?>"<?php echo $address->city->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $address->city->ViewAttributes() ?>><?php echo $address->city->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_city" id="x<?php echo $address_grid->RowIndex ?>_city" value="<?php echo ew_HtmlEncode($address->city->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->notel->Visible) { // notel ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<input type="text" name="x<?php echo $address_grid->RowIndex ?>_notel" id="x<?php echo $address_grid->RowIndex ?>_notel" size="70" maxlength="255" value="<?php echo $address->notel->EditValue ?>"<?php echo $address->notel->EditAttributes() ?>>
<?php } else { ?>
<div<?php echo $address->notel->ViewAttributes() ?>><?php echo $address->notel->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_notel" id="x<?php echo $address_grid->RowIndex ?>_notel" value="<?php echo ew_HtmlEncode($address->notel->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->state_id->Visible) { // state_id ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<select id="x<?php echo $address_grid->RowIndex ?>_state_id" name="x<?php echo $address_grid->RowIndex ?>_state_id"<?php echo $address->state_id->EditAttributes() ?>>
<?php
if (is_array($address->state_id->EditValue)) {
	$arwrk = $address->state_id->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($address->state_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $address->state_id->OldValue = "";
?>
</select>
<?php } else { ?>
<div<?php echo $address->state_id->ViewAttributes() ?>><?php echo $address->state_id->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_state_id" id="x<?php echo $address_grid->RowIndex ?>_state_id" value="<?php echo ew_HtmlEncode($address->state_id->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->country_id->Visible) { // country_id ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<select id="x<?php echo $address_grid->RowIndex ?>_country_id" name="x<?php echo $address_grid->RowIndex ?>_country_id"<?php echo $address->country_id->EditAttributes() ?>>
<?php
if (is_array($address->country_id->EditValue)) {
	$arwrk = $address->country_id->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($address->country_id->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
if (@$emptywrk) $address->country_id->OldValue = "";
?>
</select>
<?php } else { ?>
<div<?php echo $address->country_id->ViewAttributes() ?>><?php echo $address->country_id->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_country_id" id="x<?php echo $address_grid->RowIndex ?>_country_id" value="<?php echo ew_HtmlEncode($address->country_id->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->created_date->Visible) { // created_date ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<?php } else { ?>
<div<?php echo $address->created_date->ViewAttributes() ?>><?php echo $address->created_date->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_created_date" id="x<?php echo $address_grid->RowIndex ?>_created_date" value="<?php echo ew_HtmlEncode($address->created_date->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
	<?php if ($address->modified_date->Visible) { // modified_date ?>
		<td>
<?php if ($address->CurrentAction <> "F") { ?>
<?php } else { ?>
<div<?php echo $address->modified_date->ViewAttributes() ?>><?php echo $address->modified_date->ViewValue ?></div>
<input type="hidden" name="x<?php echo $address_grid->RowIndex ?>_modified_date" id="x<?php echo $address_grid->RowIndex ?>_modified_date" value="<?php echo ew_HtmlEncode($address->modified_date->FormValue) ?>">
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$address_grid->ListOptions->Render("body", "right");
?>
	</tr>
<?php
}
?>
</tbody>
</table>
<?php if ($address->CurrentMode == "add" || $address->CurrentMode == "copy") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridinsert">
<input type="hidden" name="key_count" id="key_count" value="<?php echo $address_grid->KeyCount ?>">
<?php echo $address_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($address->CurrentMode == "edit") { ?>
<input type="hidden" name="a_list" id="a_list" value="gridupdate">
<input type="hidden" name="key_count" id="key_count" value="<?php echo $address_grid->KeyCount ?>">
<?php echo $address_grid->MultiSelectKey ?>
<?php } ?>
<input type="hidden" name="detailpage" id="detailpage" value="address_grid">
</div>
<?php

// Close recordset
if ($address_grid->Recordset)
	$address_grid->Recordset->Close();
?>
<?php if (($address->CurrentMode == "add" || $address->CurrentMode == "copy" || $address->CurrentMode == "edit") && $address->CurrentAction != "F") { // add/copy/edit mode ?>
<div class="ewGridLowerPanel">
<?php if ($address->AllowAddDeleteRow) { ?>
<?php if ($Security->IsLoggedIn()) { ?>
<span class="phpmaker">
<a href="javascript:void(0);" onclick="ew_AddGridRow(this);"><img src='phpimages/addblankrow.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("AddBlankRow")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("AddBlankRow")) ?>' width='16' height='16' border='0'></a>&nbsp;&nbsp;
</span>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
</td></tr></table>
<?php if ($address->Export == "" && $address->CurrentAction == "") { ?>
<?php } ?>
<?php
$address_grid->ShowPageFooter();
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
?>
<?php
$address_grid->Page_Terminate();
$Page =& $MasterPage;
?>
